Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

Migrating SiteContext

Sitecontext was previously accessed via:

    
        UCommerce.Runtime.SiteContext.Current
    

In V9 SiteContext does not really give any value as it was basically a static wrapper around the other components. In V9 we want to embrace the use of IOC so you can instead get around your use of SiteContext with the following snippets.

CatalogContext

    
         UCommerce.Runtime.SiteContext.Current.CatalogContext
         
    

Has been replaced with the following:

    ObjectFactory.Instance.Resolve<Ucommerce.Api.ICatalogContext>();
    
    

OrderContext

    
         UCommerce.Runtime.SiteContext.Current.OrderContext
         
    

Has been replaced with the following:

    ObjectFactory.Instance.Resolve<Ucommerce.Api.IOrderContext>();
    
    

CurrentCulture

    
         UCommerce.Runtime.SiteContext.Current.CurrentCulture
         
    

Has been replaced with the following:

    CultureInfo currentCulture = ObjectFactory.Instance.Resolve<ILocalizationContext>().CurrentCulture;